//package com.lt.test.consumer.controller;
//
//import com.alibaba.dubbo.config.annotation.Reference;
//import com.lt.test.api.KtCountService;
//import com.lt.test.api.KtJoinService;
//import com.lt.test.common.constant.HttpRequestConstant;
//import com.lt.test.common.exception.CustomException;
//import com.lt.test.common.util.WebUtils;
//import com.lt.test.entity.DTO.PageDTO;
//import com.lt.test.entity.DTO.ResponseDTO;
//import net.sf.json.JSONArray;
//import net.sf.json.JSONObject;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.util.Map;
//
///**
// * 加盟申请
// * @author Ing
// *
// */
//@Controller
//@RequestMapping("/ktJoin")
//public class KtJoinController {
//
//	@Reference(version = "1.0.0")
//	private KtJoinService joinService;
//
//	@Reference(version = "1.0.0")
//    private KtCountService ktCountService;
//
//	/**
//	 * 加盟申请
//	 * @param request
//	 * @param response
//	 * @return
//	 */
//	@RequestMapping(value = "/joinApplay", method = {RequestMethod.GET, RequestMethod.POST})
//	@ResponseBody
//	public ResponseDTO joinApplay(HttpServletRequest request,HttpServletResponse response){
//		ResponseDTO responseDTO = new ResponseDTO();
//		Map<String,String> parameter = WebUtils.getAllParamMap(request);
//		 try {
//			joinService.joinApplay(parameter);
//			 responseDTO.setCode("200");
//	         responseDTO.setSuccess(true);
//	         responseDTO.setMessage("操作成功");
//		} catch (CustomException e) {
//			responseDTO.setCode(HttpRequestConstant.SERVER_ERROR_CODE);
//			responseDTO.setMessage(e.getMessage());
//			e.printStackTrace();
//		}
//
//		return responseDTO;
//
//	}
//
//	/**
//	 * 查询加盟申请信息
//	 */
//	@RequestMapping("/getApplayInfo")
//	@ResponseBody
//	public PageDTO<Map<String, Object>> getApplayInfo(HttpServletRequest request,HttpServletResponse response){
//		Map<String,String> parameter = WebUtils.getAllParamMap(request);
//		Integer page = Integer.valueOf(request.getParameter("page"));
//		Integer pageSize = Integer.valueOf(request.getParameter("rows"));
//		PageDTO<Map<String, Object>> res = joinService.getApplayInfo(page,pageSize,parameter);
//		return res;
//	}
//
//	/**
//	 * 加盟审核
//	 */
//	@RequestMapping(value = "/examApplay", method = {RequestMethod.GET, RequestMethod.POST})
//	@ResponseBody
//	public ResponseDTO examApplay(HttpServletRequest request,HttpServletResponse response){
//		ResponseDTO responseDTO = new ResponseDTO();
//		Map<String,String> parameter = WebUtils.getAllParamMap(request);
//        try {
//            joinService.examApplay(parameter);
//            responseDTO.setCode("200");
//            responseDTO.setSuccess(true);
//            responseDTO.setMessage("操作成功");
//        } catch (Exception e) {
//            e.printStackTrace();
//            responseDTO.setCode("500");
//            responseDTO.setMessage("服务器异常");
//        }
//		return responseDTO;
//	}
//
//	 /**
//     * 查询区域
//     */
//    @RequestMapping("/getArea")
//    @ResponseBody
//    public JSONArray getArea(HttpServletRequest request, HttpServletResponse response){
//        Map<String,String> parameter = WebUtils.getAllParamMap(request);
//    	JSONObject result = ktCountService.getArea(parameter);
//    	Object object = result.get("rows");
//    	JSONArray jsonArray = JSONArray.fromObject(object);
//    	return jsonArray;
//
//    }
//}
